<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="inc/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<%=jianbook.sysinfo("keyword")%>" />
<meta name="description" content="<%=jianbook.sysinfo("dsc")%>" />
<title><%if request("type")="receive" then response.Write "我的消息-" else response.Write "我发的私信-" end if%><%=jianbook.sysinfo("title")%></title>
<link href="ui/layui/css/layui.css" rel="stylesheet" type="text/css" />
<link href="ui/images/main.css" rel="stylesheet" type="text/css" />
<link href="ui/skin/<%=jianbook.css%>.css" rel="stylesheet" type="text/css" />

</head>


<body>
<%
'''jianbook 
''' ==================================================================
''' 版权所有 http://www.9416.cn
''' ------------------------------------------------------------------
''' 此程序为免费开源版，个人可免费自由使用，不得作为商业用途，不可以修改再次发布！
''' ------------------------------------------------------------------
''' 个人使用需要保留版权，如需去除版权请联系作者购买。
''' ==================================================================
%>


<%


if jianbook.isadmin() then
my_id=0
elseif request.Cookies("user")("login")="true" then
my_id=request.Cookies("user")("id")

end if
if request("type")="receive" then

conn.execute ("update  comment set isread=1 where class=2 and name='"&my_id&"'")

end if
%>
<%


set rs=conn.execute ("select count(*) as tnum from comment where isread=0 and class=2 and name='"&my_id&"'")
if rs("tnum")>0 then
snum="<span>"&rs("tnum")&"</span>"
end if
rs.close



%>
<!--#include file="head.asp"-->



<div class="main">
  
  <div class="main_top">
<div class="label">


<a href="message.asp?type=receive" <%if request("type")="receive" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我的消息<%=snum%></a>
<a href="message.asp?type=send" <%if request("type")="send" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我发的私信</a>
<a href="index.asp?order=my" <%if request("order")="my" then%> class="lactive"<%end if%> style="float:right"><i class="layui-icon layui-icon-form"></i>我发的帖子</a>
</div>


</div>
<%
if request.Cookies("user")("login")="" and request.Cookies("admin")("login")="" then 
%>
<div class="guset_mes">
您需要登录后才可以查看，
请先<a href="#" onclick="user_login()">登录</a>

</div>
<%
else
%>

<div class="comment">


<div class="c_list list-loop" >

<%
sql="select * from comment where id>0"


if request("type")="send" then
sql1=sql1&" and class=2 and uid='"&my_id&"'"
else
sql1=sql1&" and class=2 and name='"&my_id&"'"
end if

mysql=sql&sql1&" order by id desc"

rs.open mysql,conn,1,3

if not rs.eof then
dim currentpage,page_count,Pcount 
dim totalrec,endpage 
if request("page")="" then 
currentPage=1 
else 
currentPage=cint(request("page")) 
end if 
perpage=10
rs.PageSize = perpage 
rs.AbsolutePage=currentpage 
page_count=0 
totalrec=rs.recordcount 
lou=0
while (not rs.eof) and (not page_count = rs.PageSize) 

if request("type")="send" then
author_id=rs("name")

mes_tit="我发给："
else
mes_tit="发信人："
author_id=rs("uid")
end if

select case author_id
case "0"
author_name="admin"

case else
sql="select * from [user] where id="&author_id
rst.open sql,conn,1,1 
if not rst.eof then
author_name=rst("username")

end if

rst.close

end select


%><div class="c_show loop">


<div class="details-avatar">
<%jianbook.user_tx author_id,rs("ip")%>
        </div>
<div class="comment_list" >
<ul><li>  
  
      <h1><%=mes_tit%><%=author_name%></h1>
     
     <h2> <%=jianbook.formatdate(rs("intime"))%> </h2></li>
 
   
  
    <li ><article ><%=jianbook.enhtml(rs("content"))%> </article>
     
     <%if rs("pic")<>"" then%>
     <div  class="c_pic">
     <%
	  mpic=split(rs("pic"),",")
	  for pi=0 to ubound(mpic)
	  %>
 <a href="<%=mpic(pi)%>"  ><img src="<%=mpic(pi)%>" /></a>
    <%
	next%>
    </div>
<%end if%>
      </li>
      
        <%
 
 rsql="select * from [comment] where upid="&rs("id")&""
 if request("order")="my" then
rsql1=" and uid='"&my_id&"'"
end if
 sql=rsql&rsql1&" order by id asc"
rs1.open Sql,conn,3,1
	if not rs1.eof then
	i=0%>
    <div class="readmore">
	 <div class="reply_div">  
       <%do while not rs1.eof
	   select case rs1("type")
case 0
mtype="游客"
case 1
mtype="管理员"

case 2
mtype=" 会员"
end select
	i=i+1%>
      <div class="reply_list">
      <ul>
      <li><h1><%
	  if rs1("uid")=0 then
	  response.Write "admin"
	  else
	  sql="select * from [user] where id="&rs1("uid")
	
rst.open sql,conn,1,1 
if not rst.eof then
response.Write rst("username")

end if

rst.close
end if
	  
	  %> </h1><h2> <%if rs1("ip")<>"" then response.Write look_ip(rs1("ip"))&" | " end if%><%=jianbook.formatdate(rs1("intime"))%></h2>
      <%if jianbook.isadmin() or request.Cookies("user")("id")=rs1("uid")  then%> 
      <span class="layui-icon layui-icon-delete" onclick="del_reply(this,<%=rs1("id")%>,<%=rs1("upid")%>)" ></span> <%end if%> </li>
    <li><article > <%=jianbook.enhtml(rs1("content"))%></article>
  
    
    </li>
   
      </ul>
      <div class="clear"></div>
        <%if i<>rs1.recordcount and rs1.recordcount>1 then %><div class="line"></div><%end if%>
      </div>
     
      <%rs1.movenext
	  loop%>
      </div>
      </div>
      <%
	   end if
	  rs1.close
	
	  %>
        

     </ul>
     <div class="clear"></div>
         
   <div class="c_tool">
 <%if rs("noreply")=false then%>  
 <span class="layui-icon layui-icon-dialogue" onclick="tc('回复','lib/message.asp?upid=<%=rs("id")%>&class=2&send=<%=author_id%>',800,400)"><b><%=rs("reply")%></b></span> 
 <%end if%>
<%if jianbook.isadmin() or request.Cookies("user")("id")=rs("uid") then%> 
<span class="layui-icon layui-icon-close" onclick="dell(this,<%=rs("id")%>)"></span> 
<%end if%> 

 <%if rs("file")<>"" then%>


 <a href="javascript:void(0)" class="c_file" onclick="down_file(<%=rs("id")%>)"><i class="iconfont icon-fujian1"></i> 附件下载</a> 
 <%end if%>


</div>
       </div></div>
<%page_count = page_count + 1 
rs.movenext 
lou=lou+1
wend
else
%>
<div class="guset_mes">
没有消息

</div>
<%
end if
rs.close%>


</div>
<div class="pagemore">
<%
if totalrec>perpage then
dim ii,p,n 
if totalrec mod perpage=0 then 
n= totalrec \ perpage 
else 
n= totalrec \ perpage+1 
end if 

if currentPage=n then 
response.Write"<a href='' class=page_none></a>"
else
response.Write"<a href='?page="&currentPage +1&"&lm="&request("lm")&"&order="&request("order")&"&uid="&request("uid")&"' class='layui-btn layui-btn-primary' >查看更多</a>"
end if
end if

  %>
</div>

</div>
<%end if%>
</div>
<div class="foot">© <%=year(now())%> 　<%=jianbook.cor%></div>



<script type="text/javascript" src="ui/jquery.js"></script>
<script type="text/javascript" src="ui/layui/layui.js"></script>

<script type="text/javascript" src="ui/jq.js"></script>

<script type="text/javascript" src="ui/pc.js?11"></script>


</body>
</html>
